package cn.bestick.cblog.dao;

import java.util.List;
import cn.bestick.cblog.dmo.Article;
import cn.bestick.cblog.dto.AboutDto;
import cn.bestick.cblog.dto.ArticleDto;
import cn.bestick.cblog.dto.ArticleLiteDto;
import cn.bestick.cblog.util.PageBean;

public interface ArticleDao {
	// getArticles() : 文章分页查询
	public List<ArticleDto> search(Article article)
			throws Exception;

	// getArticles() : 文章分页列表
	public List<ArticleDto> pagenation(PageBean pageBean) throws Exception;

	// getRecentArticles() 最近文章列表 article(id , title)
	public List<ArticleLiteDto> getRecentArticles() throws Exception;

	// getArticle 具体文章 article(title,content,pubdate,category,clicks,content)
	public ArticleDto get(Integer id) throws Exception;

	// getPreArticle() article(title)
	public ArticleLiteDto getPre(Integer id) throws Exception;

	// getNextArticle() article(title)
	public ArticleLiteDto getNext(Integer id) throws Exception;

	// getArticleByCategory() 文章列表 article(title,pubdate)
	public List<ArticleLiteDto> getByCategory(int categoryId) throws Exception;

	// getArchive() articles 归档文章列表 article(title,pubdate)
	public List<ArticleLiteDto> archive() throws Exception;

	// getAbout() about 具体文章 about(content)
	public AboutDto getAbout() throws Exception;

	// updateAbout() about 具体文章 about(content)
	public void updateAbout(AboutDto about) throws Exception;

	// saveAbout() about 具体文章 about(content)
	public void saveAbout(AboutDto about) throws Exception;

	// updateArticle() about 具体文章
	public void update(Article article) throws Exception;

	// saveArticle() article具体文章
	public void save(Article article) throws Exception;

	// deleteArticle() article具体文章
	public void delete(Integer id) throws Exception;

	public int count() throws Exception;
}
